package org.hpin.asset.dao;

import java.util.List;

import org.hpin.asset.entity.Borrowinfo;
import org.hpin.common.core.orm.BaseDao;
import org.springframework.stereotype.Repository;

@Repository
public class BorrowinfoDao extends BaseDao{
	
	public Borrowinfo findMax(){
		String hql="from Borrowinfo a where a.borrowNo=(select max(b.borrowNo) from Borrowinfo b" +
				" where trunc(b.createTime) = trunc(sysdate))";
		List<Borrowinfo> list=this.getHibernateTemplate().find(hql);
		if(list.size()==0){
			return null;
		}else{
			return list.get(0);
		}
	}

}
